<div id="form_example">
<style>
    fieldset table tr em {
        color: #ff0000;
    }

    fieldset table tr th {
        text-align: left;
        vertical-align: top;
    }
</style>

    <a href="<?php echo $this->url(array('action' => 'index'), 'example_action'); ?>"><?php echo BaseZF::escape(_('Back to example index')); ?></a>

    <form id="form_example" method="post" action="<?php echo $this->url();?>">
    <fieldset>
    <legend><?php echo BaseZF::escape(_('Form example with check system')); ?></legend>
        <table>
            <?php /* Input type text example */ ?>
            <tr>
                <th><label for="integer">integer</label></th></th>
                <td><?php echo $this->formText('integer', $this->params['integer']); ?></td>
                <td><?php echo (isset($this->paramsErrors['integer']) ? '<em>' . BaseZF::escape(_(implode("\n", $this->paramsErrors['integer']))) . '</em>' : '') ?></td>
            </tr>

            <tr>
                <th><label for="float">float</label></th>
                <td><?php echo $this->formText('float', $this->params['float']); ?></td>
                <td><?php echo (isset($this->paramsErrors['float']) ? '<em>' . BaseZF::escape(_(implode("\n", $this->paramsErrors['float']))) . '</em>' : '') ?></td>
            </tr>

            <tr>
                <th><label for="mail">mail</label></th>
                <td><?php echo $this->formText('mail', $this->params['mail']); ?></td>
                <td><?php echo (isset($this->paramsErrors['mail']) ? '<em>' . BaseZF::escape(_(implode("\n", $this->paramsErrors['mail']))) . '</em>' : '') ?></td>
            </tr>

            <tr>
                <th><label for="alpha">alpha</label></th>
                <td><?php echo $this->formText('alpha', $this->params['alpha']); ?></td>
                <td><?php echo (isset($this->paramsErrors['alpha']) ? '<em>' . BaseZF::escape(_(implode("\n", $this->paramsErrors['alpha']))) . '</em>' : '') ?></td>
            </tr>

            <tr>
                <th><label for="aplha-num">alpha-num (Not Empty)</label></th>
                <td><?php echo $this->formText('alpha-num', $this->params['alpha-num']); ?></td>
                <td><?php echo (isset($this->paramsErrors['alpha-num']) ? '<em>' . BaseZF::escape(_(implode("\n", $this->paramsErrors['alpha-num']))) . '</em>' : '') ?></td>
            </tr>

            <tr>
                <th><label for="aplha-num2">alpha-num (Can Empty)</label></th>
                <td><?php echo $this->formText('alpha-num2', $this->params['alpha-num2']); ?></td>
                <td><?php echo (isset($this->paramsErrors['alpha-num2']) ? '<em>' . BaseZF::escape(_(implode("\n", $this->paramsErrors['alpha-num2']))) . '</em>' : '') ?></td>
            </tr>

            <tr>
                <th><label for="date">date</label></th>
                <td><?php echo $this->formText('date', $this->params['date']); ?></td>
                <td><?php echo (isset($this->paramsErrors['date']) ? '<em>' . BaseZF::escape(_(implode("\n", $this->paramsErrors['date']))) . '</em>' : '') ?></td>
            </tr>
            <tr>
                <td colspan="3">

                <?php
                    if (is_null($this->params['no_ajax'])) {
                        echo $this->formHidden('submit', 1);
                        echo $this->formSubmit('ajax', 'Submit with Ajax');
                    } else {
                        echo $this->formHidden('no_ajax', 1);
                        echo $this->formSubmit('submit', 'Submit');
                    }
                ?>
                <?php echo $this->formReset('cancel', 'Cancel'); ?>
                <?php
                    if (is_null($this->params['no_ajax'])) {
                        ?>- <a href="<?php echo $this->url(); ?>?no_ajax=1"><?php echo BaseZF::escape(_('Disable ajax')); ?></a><?php
                    } else {
                        ?>- <a href="<?php echo $this->url(); ?>"><?php echo BaseZF::escape(_('Enable ajax')); ?></a><?php
                    }
                ?>
            </tr>
        </table>
    </fieldset>
    </form>


    <ul>
        <li><a onclick="window.open(this.href); return false;" href="/doc/html/formcheck_8php-source.html"><?php echo BaseZF::escape(_('See view source')); ?></a></li>
        <li><a onclick="window.open(this.href); return false;" href="/doc/html/classExampleController.html#4cdc733e41a194fc289189d6d10e7e8d"><?php echo BaseZF::escape(_('See action source')); ?></a></li>
    </ul>

<?php
if (empty($this->paramsErrors) && !is_null($this->params['submit'])) {
?>
    <p style="color: #38C02E">Ok !</p>
    <pre>
        <?php print_r($this->params); ?>
    </pre>
<?php
}
?>
</div>

